home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-10-17 | 4.0 KB | 103 lines | [TEXT/KAHL] |
-
- ICN# Push Button CDEF
- by Michael F. Kamprath
-
- Copyright © 1993 by Michael F. Kamprath
-
- Requirments:
- ============
-
- This CDEF can only be used with system 7.0 or later. This is because
- this CDEF uses System 7's Color Icon family manager.
-
- Description
- ===========
-
- This CDEF uses an icon family setup in a program's resource
- fork to define how a push button will look in each of it's
- three states: 1) Button up & disengaged, 2) Button up & engaged,
- and 3) Button depressed. This CDEF uses icon families starting with
- id's 1000 (potentially) through 1047 in set's of three. This first of
- each set is the icon used for the button up & disengaged, the second
- for button up & engaged, and the third for button depressed.
-
- This CDEF can be used with up to 16 different button's at the
- same time. This is done through the variation code used when creating
- the control. The icon family set used for a particular variation code
- starts at the base ICN# ID for this CDEF (1000) plus 3 times the variation
- code. For example, if the ICN# CDEF is in CDEF resource
- id 1000, and uses a variation code of 2, then when one create's a controls
- with the command:
-
- hCtl = NewControl( theWindow, &ctrlRect, title, visible,
- initialValue, min, max, 1000*16 + 2, refCon );
-
- Would use the following ICN# id's for:
- 1006 ==> Button up & disengaged
- 1007 ==> Button up & engaged
- 1009 ==> Button down
-
- Recall that the resource ID of the CDEF used much be multiplied by 16 for
- the proper bit shift for the control manager. This effectly means that
- this CDEF can be used for up to 16 different icon pushbuttons.
-
- The button is considered engaged when it's control value is something other
- than zero.
-
- There are only two hilite states your code needs to manage for this CDEF.
- A hilite state of 0 means the control is useable, and a hilite state of 255
- is the "dimmed" state of the control. DO NOT set the hilite state to anything
- other than these two states for it will cause the button to be in it's
- "depressed" mode.
-
- NOTEs:
-
- 1. Proper definition of the icon family's (ICN#) mask is a must because this
- CDEF uses the mask to determine if a test point is in the control. Be sure to use
- the same mask for each icon in a button's set to ensure proper updating of the button.
-
- 2. You must define the control rect to be either 32x32 or 16x16. If you define
- the control rect as 32x32, then the proper ICN# family will be used. If you
- use a control rect of 16x16, then the proper icn# family will be used. This
- is inherent to System 7's icon plotting routine's.
-
- 3. If you want the color version of your icon family's to be used, you must use
- a color window or dialog. System 7's icon plotting routine automatically plot's
- the correct icon for the current monitor depth.
-
- Shareware Info:
- ===============
-
- If you use this CDEF for personal use, all I ask is that you send me a note
- and maybe a copy of the program you use it in.
-
- If you use this CDEF for somethiong that you later charge money for (like
- your own shareware software or commercial software), the price for it's use
- is a one time payment of $5 and maybe a copy of your program. If you don't
- wish to give me a free copy of your program, I understand (after all, I'm
- asking for money).
-
- If you wish for the source code to this CDEF, I will send it to you if you
- include a disk with your shareware payment ($5). I will not send the source
- code out with out the shareware payment or the disk (though I will send it
- via e-mail if you send me the shareware payment before I lose my e-mail
- account).
-
- Please make all payments in U.S. funds.
-
- You may contact me by:
-
- e-mail: kamprath@engin.umich.edu (valid until Jan, 1994)
-
- postal mail: Michael F. Kamprath
- 481 NW Eleventh Ave.
- Boca Raton, FL 33486
-
- Legal Stuff
- ===========
-
- I provide no warranty, written or implied, nor do I accept any responsibility
- for damages inflicted, real or imagined, by the use of this CDEF.
-
- This CDEF was wrriten in THINK C v5.0. Therefore, some portions are copyrighted
- by Symantec.